use std::thread::sleep;
use std::time::Duration;
use lipo_citc_qkey::send_data;

fn main() {
    println!("程序开始");
    let key = b"ajdsklsqxjiaqxnf";
    // let content = "ajdsklsqxjiaqxnfssdsa";
    // let value = lipo_citc_qkey::lencrypted::sm4_encrypt(key, content.as_bytes(), true);
    //
    // println!("{}", hex::encode(value));

    // let content = hex::decode("0c18d08310c1c8f41c3a6e1ed8263a0600e317fa876bceaf90b227f6bcb3587b").unwrap();
    // let mut value = lipo_citc_qkey::lencrypted::sm4_encrypt(key, content.as_slice(), false);
    // println!("{:?}", std::str::from_utf8_mut(&mut value));

    // println!("{:?}", lipo_citc_qkey::lencrypted::sm3_encode("我是一只可爱的小花猫"))

    // println!("{:?}",  hex::encode(lipo_citc_qkey::lencrypted::sm4_gcm_encode(key, "我是一只可爱的小花猫aa".as_bytes())));
    // let bytecode = hex::decode("8744dd3164f692cff5b259e8f4b3ed827482ae2f36521bf48aab11130ac28bbf2a8c4acaf3ba854a3855c003f5faa5ca").unwrap();
    // let mut result =  lipo_citc_qkey::lencrypted::sm4_gcm_decode(key, &bytecode).unwrap();
    // println!("{:?}", std::str::from_utf8_mut(&mut result));

    // let mut byte01 = [1u8, 0x01, 0x03, 0x04];
    // println!("{:?}", byte01);
    // lipo_citc_qkey::ltools::lbyte::swap(&mut byte01);
    // println!("{:?}", byte01);
    // let result =  lipo_citc_qkey::ltools::lbyte::key_index(&byte01, 0);
    //   println!("{:?}", result);

    // lipo_citc_qkey::lproperties::test();

    lipo_citc_qkey::lencrypted::test_ring();
    println!("进入等待");
    // lipo_citc_qkey::test_init();
    //
    // sleep(Duration::from_secs(1));
    // send_data(1);
    // sleep(Duration::from_secs(1));
    // send_data(2);
    // sleep(Duration::from_secs(1));
    // send_data(3);
    // println!("运行结束，等待中...");

    // lipo_citc_qkey::ltools::test_tools();

    sleep(Duration::from_secs(20));
    println!("程序结束");
}



